{% extends "templates/base.html" %}
{% block title %}{{ _('Job Openings') }}{% endblock %}

{% block content %}
{% set allow_posting = frappe.db.get_single_value("Job Settings", "allow_posting") %}
<div class="common-page-style">
  <div class="container">

  {% if allow_posting and jobs | length %}
  <a class="button is-primary pull-right" href="/job-opportunity?new=1">{{ _("Post a Job") }}</a>
  {% endif %}

  <div class="course-home-headings">{{ _("Job Openings") }}</div>
  {% if jobs | length %}
  <div class="job-card-parent">
      {% for job in jobs %}
        <div class="common-card-style course-card">
          {% set show_edit_link = False %}
          {% include "school/templates/job_card.html" %}
          <a class="stretched-link" href="/jobs/{{ job.name }}"></a>
        </div>
      {% endfor %}
    </div>
    {% else %}
    <div class="empty-state text-center">
      <img class="icon icon-xl" src="/assets/frappe/icons/timeless/message.svg">
      <div class="course-home-headings mt-4 mb-0" style="color: inherit;"> {{ _("No open jobs") }} </div>
      <div class="small mb-6"> {{ _("There are no job openings at present.") }} </div>
      {% if allow_posting %}
      <a class="button is-secondary dark-links m-auto" href="/job-opportunity?new=1">{{ _("Post a Job") }}</a>
      {% endif %}
    </div>
    {% endif %}
  </div>
</div>
{% endblock %}
